package com.example.tests;


import java.io.File;
import java.io.IOException;

import org.apache.commons.io.FileUtils;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebDriver;

public class WebDriverUtils {

	WebDriver driver;
	
	public void WebDriverUtils(WebDriver driver){
		this.driver = driver;
	}
	
	public void TakeScreenShot(String ScreenShotName) throws IOException {
		File ScreenShotFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
	    FileUtils.copyFile(ScreenShotFile, new File("C:\\New trry\\Selenium-Mail-Search\\Screen\\"+ ScreenShotName +".png")); 
	}
	        
}
